<%-- 
    Document   : viewProductDetails
    Created on : Nov 22, 2012, 8:14:29 AM
    Author     : tuan
--%>

<%@page import="data.ProductEntity"%>
<%@page import="data.ProductDAL"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <%
            String productID = request.getParameter("productID");
        %>
        <h1>All product Details</h1>
        <%
            ProductEntity product = ProductDAL.searchById(productID);
        %>
        <form action="AddToCart.jsp?proID=<%=productID%>" method="post">
            <table> 
                <tr>
                    <th>Product Name</th>
                    <th> Category ID</th>
                    <th>Unit Price </th>
                    <th>Units In Stock</th>
                    <th>Units In Order</th>
                    <th>Product Image</th>
                    <th> Description</th></tr>

                <tr>
                    <th>Product ID</th><td><%=product.getProductId()%></td>
                </tr>
                <tr>
                    <th>Category ID</th><td><%=product.getCategoryId()%></td>
                </tr>
                <tr>
                    <th>Unit Price</th><td><%=product.getUnitPrice()%></td>
                </tr>
                <tr>
                    <th>Units In Stock</th><td><%=product.getUnitsInStock()%></td>
                </tr>
                <tr>
                    <th>Units In Order</th><td><%=product.getUnitsInOrder()%></td>
                </tr>
                <tr>
                    <th>Product Image</th><td><%=product.getProductName()%></td>
                </tr>
                <tr>
                    <th>Description</th><td><%=product.getDescription()%></td>
                </tr>
                <tr>
                    <td>
                        <input type="submit" value="AddToCart">
                    </td>
                </tr>
            </table>

        </form>
    </body>
</html>
